package com.lotusfall.mapper;

import com.lotusfall.pojo.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface RoleMapper {
    /**
     * 根据UserId查询用户的角色
     * @param userid
     * @return
     */
    @Select("select r.* from tb_role r join tb_user_role u on r.id = u.roleid where u.userid = #{userid}")
    List<Role> listRoleByUserId(Long userid);
}
